package com.eagle.depthinspringboot.configuration;

import com.eagle.samples.autoconfigure.formatter.Formatter;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

import java.util.HashMap;
import java.util.Map;

@SpringBootApplication
public class AutoConfigureApplication {

	public static void main(String[] args) {

		ConfigurableApplicationContext context = SpringApplication.run(AutoConfigureApplication.class, args);

		Map<String,Object> map = new HashMap();
		map.putIfAbsent("abc","dafei");
		Formatter formatter = context.getBean(Formatter.class);
		System.out.printf("%s format(map): %s\n",formatter.getClass().getSimpleName(),formatter.format(map));

	}
}
